package com.htfyun.eink.pw.draw;

import android.view.View;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.htfyun.eink.pw.draw.pen.IPenEraser;
import com.htfyun.eink.pw.draw.pen.IPenWriter;

import java.util.List;

public interface IPWDraw extends IPWDrawProperty {

    /**
     * 绑定 view
     *
     * @param view 手写的那个 view
     */
    void bindView(@NonNull View view);

    /**
     * 解绑 view
     *
     * @param view {@link #bindView(View)} 的需相等.
     */
    void unbindView(@NonNull View view);

    /**
     * 清除 bmp 内容.
     */
    void clearAllBmp();

    /**
     * 清掉内存. 就是清掉 bmp 的内存.
     */
    void clearMemory();

    /**
     * 添加 pen writer
     * @param penWriter {@link IPenWriter}
     */
    void registerPenWriter(@NonNull IPenWriter penWriter);

    /**
     * 删除 pen writer
     * @param penWriter {@link IPenWriter}
     */
    void unregisterPenWriter(@NonNull IPenWriter penWriter);

    /**
     * @return 返回注册了的 {@link IPenWriter} writer 列表
     */
    @NonNull
    List<IPenWriter> getRegisteredPenWriterList();

    /**
     * 添加 pen eraser
     * @param penEraser {@link IPenEraser}
     */
    void registerPenEraser(@NonNull IPenEraser penEraser);

    /**
     * 删除 pen eraser
     * @param penEraser {@link IPenEraser}
     */
    void unregisterPenEraser(@NonNull IPenEraser penEraser);

    /**
     * @return 返回注册了的 {@link IPenEraser} eraser 列表
     */
    @NonNull
    List<IPenEraser> getRegisteredPenEraserList();

}
